﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Runtime.InteropServices;
using System.Windows.Interop;

namespace Bainx.WPF.Extend
{
    /// <summary>
    /// 画笔类型扩展
    /// </summary>
    public static class BrushExtend
    {
        /// <summary>
        /// 改变画笔的不透明度
        /// </summary>
        /// <param name="b"></param>
        /// <param name="Opacity"></param>
        /// <returns></returns>
        public static Brush OpacityChange(this Brush b, double Opacity)
        {
            if (b != null)
            {
                Brush ret = b.Clone();
                ret.Opacity = Opacity;
                return ret;
            }
            else
                return null;
        }
    }
}
